package com.joycessh.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.joycessh.entity.Post;
import com.baomidou.mybatisplus.extension.service.IService;
import com.joycessh.vo.PostVo;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author Joycessh
 * @since 2019-08-18
 */
public interface PostService extends IService<Post> {
    Post get(long id);

    boolean update(Post post);

    boolean delete(long id);

    void initIndexWeekRank();

    void zUnionAndStoreLast7DaysForLastWeekRank();

    void incrZsetValueAndUnionForLastWeekRank(Long postId, boolean isIncr);

    IPage paging(Page page, Long userId, Long categoryId, Integer level, Boolean recommend, String order);

    PostVo selectOne(QueryWrapper<Post> wrapper);
}
